import React from 'react';
import {  Input,Button } from 'antd';
import hoc from '../../component/InputHoc/Input-Hoc';
import { SearchOutlined } from '@ant-design/icons';
import './VipManage.css';
import TableContent from '../../component/TableContent/TableContent'
import Bread from '../../component/TableContent/VipBread'
import axios from '../../utils/http'

@hoc
class VipManage extends React.Component {
  // formRef = React.createRef()
  constructor() {
    super()
    this.state = {
      tabledata:[]
    }
  }
  selectInfo = () => {
    axios({
      url: '/member/queryMemberByNnAndPhone',
      method: 'get',
      params: {
        memberNn: this.props.nick,
        memberPhone: this.props.phone
      },
    }).then(({data}) => {
      console.log(data.data)
      this.setState({
        tabledata:data.data
      })
    })
  }
  restart = () => {
    // this.formRef.current.resetFields();
    axios({
      url: '/member/queryMemberByNnAndPhone',
      method: 'get',
      params: {
        memberNn: '',
        memberPhone: ''
      },
    }).then(({data}) => {
      console.log(data.data)
      this.setState({
        tabledata:data.data
      })
    })
  }
  render() {
    let { getnick} = this.props
    return (
      <div className='VipManage'>
        <Bread mianbao='会员管理'></Bread>
        <div className='search'>
          昵称 <Input  placeholder="请输入昵称(回车键确定输入完成)" allowClear onChange={getnick(1)} />
          手机号码 <Input  placeholder="请输入手机号码(回车键确定输入完成)" allowClear onChange={getnick(2)} />
          <Button className='sousuo' type="primary" icon={<SearchOutlined className='serachbtn' />} onClick={this.selectInfo}>搜索</Button>
        </div>
        <TableContent whopage='vipmanage' shuju={ this.state.tabledata}></TableContent>
      </div>
    ) 
  }
}
export default VipManage;